# coding = utf-8
'''Train Tickets Query Via CLI;

Usage:
    run.py [-dgktz] <from> <to> <date>
    run.py --version
    run.py (-h | --help)

Options:
    -h --help    帮助
    --version    显示版本
    -d        动车
    -g        高铁
    -t        特快
    -k        快车
    -z        直达
'''
from docopt import docopt
import sys
from os import path

#添加系统路径
sys.path.append(path.dirname(path.abspath(__file__)))

from core.cli import Cli
from core.ticket import Ticket



def main():
    arguments = docopt(__doc__, version='Ticket 1.0')
    cli = Cli(arguments)
    ticket = Ticket(cli.get_from_station_name(),cli.get_to_station_name(),
            cli.get_start_date(),options =cli.get_options())
    # 查询火车票
    ticket.query_ticket()

if __name__ == '__main__':
    main()
